package API.DAY3.collection;

import java.util.ArrayList;
import java.util.Collection;
//addAll()添加所有,containsAll()判断是否包含,removeAll()删除所有
public class CollectionDemo4 {
    public static void main(String[] args) {
        Collection a = new ArrayList<>();
        a.add("c++");
        a.add("java");
        a.add("python");
        System.out.println(a);
        Collection b = new ArrayList();
        b.add("spring");
        b.add("mysql");
        b.add("meven");
        System.out.println(b);

        a.addAll(b);
        System.out.println(a);
        System.out.println(b);

        Collection c = new ArrayList();
        c.add("java");
        c.add("python");
        c.add("html");
//        c.add("c++");
        boolean contains = a.containsAll(c);
        System.out.println(contains);

//        a.retainAll(c);
//        System.out.println(a);
//        System.out.println(c);
        a.removeAll(c);
        System.out.println(a);
        System.out.println(c);
    }
}
